package net.alpcontrol.bi.colligation.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.alpcontrol.bi.bootstrap.bean.Message;
import net.alpcontrol.bi.colligation.entity.Company;
import net.alpcontrol.bi.colligation.service.ICompanyService;
import net.alpcontrol.bi.colligation.service.IMailService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 丛庆
 * @since 2020-08-31
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@Api(tags = {""})
@RestController
@RequestMapping("/mail")
public class MailController {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private IMailService mailService;

    @ApiOperation(value = "发送HTML格式的邮件")
    @RequestMapping(value = "/sendMail", method = RequestMethod.POST)
    public Message sendMail(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content){
        mailService.sendHtmlMail(email,title,content);
        return Message.success("发送成功！");
    }

}
